/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package helper;

import java.awt.event.ActionEvent;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import model.*;
/**
 *
 * @author Administrator
 */
@ManagedBean(name = "pb")
@SessionScoped
public class PersonBean {

    Applicant ap = new Applicant();

    public Applicant getAp() {
        return ap;
    }

    public void setAp(Applicant ap) {
        this.ap = ap;
    }
    public PersonBean() {
    }
    public void savePerson(ActionEvent actionEvent) {  
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Welcome !"));  
    }  
    public void event(){
        String inp = "";
        if(this.ap.getPhoneNumber().equals("")){
            inp = "You must enter Phone number .";
             FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(inp)); 
        }
    }
}
